package com.sm.controller;

import java.util.List;

import com.sm.model.Activities;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sm.service.ActivitiesService;
import com.sm.util.Msg;

//*************
@Controller
@RequestMapping("/activities")
public class ActivitiesController {

	@Autowired
	private ActivitiesService activitiesService;
	
	/**
	 * 查询近期活动
	 * @return
	 */
	/*@RequestMapping("/selectActivities")
	@ResponseBody
	public Msg selectActivities() {
		List<Activities> list = activitiesService.selectActivitiesNow();
		return Msg.success().add("list", list);
	}*/
	
	/**
	 * 参会券
	 * @return
	 */
	/*@RequestMapping("/selectActivitiesByTime")
	@ResponseBody
	public Msg selectActivitiesByTime() {
			List<Activities> list = activitiesService.selectActivitiesNow();
			//List<Activities> listBefore = us;
			return Msg.success().add("list", list).add("listBefore", list);
		
	}*/

	/**
	 * 查询参会券近期活动
	 * @return
	 */
	/*@RequestMapping("/selectActivitiesNow")
	@ResponseBody
	public Msg selectActivitiesNow() {
		List<Activities> list = activitiesService.selectActivitiesNow();
		return Msg.success().add("list", list);
	}*/
	/**
	 * 查询参会券过期活动
	 * @return
	 */
	/*@RequestMapping("/selectActivitiesBefore")
	@ResponseBody
	public Msg selectActivitiesBefore() {
		List<Activities> listBefore = activitiesService.selectActivitiesBefore();
		return Msg.success().add("listBefore", listBefore);
	}*/

	/**
	 * 查询活动详情
	 * @param activitiesId
	 * @return
	 */
	@RequestMapping("/selectActivitiesById")
	@ResponseBody
	public Msg selectActivitiesById(Integer activitiesId) {
		Activities activities = activitiesService.selectActivitiesById(activitiesId);
		return Msg.success().add("activities", activities);
	}
}
